﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace HartConfigTool.UI
{
    public interface IObserver
    {
        void Update(List<string> listStr);
    }

    static public class ObserversInfo
    {
        //public static Dictionary<string, string> DebugCMDs = new Dictionary<string, string>()
        //{
        //    { "DebugMsg", "DebugMessage"},
        //};

        public static Dictionary<int, string> HARTCMDsID = new Dictionary<int, string>()
        {
            { 0, "#0 ReadUniqueIdentifier"},
            { 1, "#1 ReadPrimaryVariable"},
            { 2, "#2 ReadPVCurrentAndPerOfRange"},
            { 3, "#3 ReadDynamicVariablesAndLoopCurrent"},
            { 6, "#6 WritePollingAddress"},
            { 7, "#7 ReadLoopConfiguration"},
            { 8, "#8 ReadDynamicVariableClassifications"},
            { 12, "#12 ReadMessage"},
            { 13, "#13 ReadTagDescriptorDate"},
            { 14, "#14 ReadPVTansducerInfo"},
            { 15, "#15 ReadDeviceInformation"},
            { 34, "#34 WritePrimaryVariableDampingValue"},
        };
        public static Dictionary<string, string> HARTCMD0Observers = new Dictionary<string, string>()
        {
            { "All",                          "HART CMD0 All"},
            { "HART Rev",                     "HART CMD0 HART Revision"},
            { "Software Rev",                 "HART CMD0 Software Revision"},
            { "Hardware Rev",                 "HART CMD0 Hardware Revision"},
            { "Device ID",                    "HART CMD0 Device ID"},
            { "Manufacturer ID",              "HART CMD0 Manufacturer ID"},
        };
        public static Dictionary<string, string> HARTCMD1Observers = new Dictionary<string, string>()
        {
            { "All",                          "HART CMD1 All"},
            { "PV Unit",                      "HART CMD1 Primary Variable Unit"},
            { "PV",                           "HART CMD1 Primary Variable"},
        };
        public static Dictionary<string, string> HARTCMD2Observers = new Dictionary<string, string>()
        {
            { "All",                          "HART CMD2 All"},
            { "PV Loop Current",              "HART CMD2 Primary Variable Loop Current"},
            { "PV Percent of Range",          "HART CMD2 Primary Variable Percent of Range"},
        };
        public static Dictionary<string, string> HARTCMD3Observers = new Dictionary<string, string>()
        {
            { "All",                          "HART CMD3 All"},
            { "PV Loop Current",              "HART CMD3 Primary Variable Loop Current"},
            { "PV Units Code",                "HART CMD3 Primary Variable Units Code"},
            { "PV",                           "HART CMD3 Primary Variable"},
            { "SV Units Code",                "HART CMD3 Secondary Variable Units Code"},
            { "SV",                           "HART CMD3 Secondary Variable"},
            { "TV Units Code",                "HART CMD3 Tertiary Variable Units Code"},
            { "TV",                           "HART CMD3 Tertiary Variable"},
            { "QV Units Code",                "HART CMD3 Quaternary Variable Units Code"},
            { "QV",                           "HART CMD3 Quaternary Variable"},
        };
        public static Dictionary<string, string> HARTCMD7Observers = new Dictionary<string, string>()
        {
            { "All",                          "HART CMD7 All"},
            { "Polling Addr",                 "HART CMD7 Polling Address of Device"},
            { "Loop Current Mode",            "HART CMD7 Loop Current Mode"},
        };
        public static Dictionary<string, string> HARTCMD8Observers = new Dictionary<string, string>()
        {
            { "All",                          "HART CMD8 All"},
            { "PV Cls",                       "HART CMD8 Primary Variable Classification"},
            { "SV Cls",                       "HART CMD8 Secondary Variable Classification"},
            { "TV Cls",                       "HART CMD8 Tertiary Variable Classification"},
            { "QV Cls",                       "HART CMD8 Quaternary Variable Classification"},
        };
        public static Dictionary<string, string> HARTCMD12Observers = new Dictionary<string, string>()
        {
            { "All",                          "HART CMD12 All"},
            { "Msg0",                         "HART CMD12 Message0"},
            { "Msg1",                         "HART CMD12 Message1"},
            { "Msg2",                         "HART CMD12 Message2"},
            { "Msg3",                         "HART CMD12 Message3"},
            { "Msg4",                         "HART CMD12 Message4"},
            { "Msg5",                         "HART CMD12 Message5"},
            { "Msg6",                         "HART CMD12 Message6"},
            { "Msg7",                         "HART CMD12 Message7"},
            { "Msg8",                         "HART CMD12 Message8"},
            { "Msg9",                         "HART CMD12 Message9"},
            { "Msg10",                        "HART CMD12 Message10"},
            { "Msg11",                        "HART CMD12 Message11"},
            { "Msg12",                        "HART CMD12 Message12"},
            { "Msg13",                        "HART CMD12 Message13"},
            { "Msg14",                        "HART CMD12 Message14"},
            { "Msg15",                        "HART CMD12 Message15"},
            { "Msg16",                        "HART CMD12 Message16"},
            { "Msg17",                        "HART CMD12 Message17"},
            { "Msg18",                        "HART CMD12 Message18"},
            { "Msg19",                        "HART CMD12 Message19"},
            { "Msg20",                        "HART CMD12 Message20"},
            { "Msg21",                        "HART CMD12 Message21"},
            { "Msg22",                        "HART CMD12 Message22"},
            { "Msg23",                        "HART CMD12 Message23"},
        };
        public static Dictionary<string, string> HARTCMD14Observers = new Dictionary<string, string>()
        {
            { "Transducer SN",                        "Transducer Serial Number"},
            { "Transducer Li And Mini Span Unit",     "Transducer Limits and Mini Span Units Code"},
            { "Upper Transducer Limit",               "Upper Transducer Limit"},
            { "Lower Transducer Limit",               "Lower Transducer Limit"},
            { "Mini Span",                            "Minimum Span"},
        };
        public static Dictionary<string, string> HARTCMD15Observers = new Dictionary<string, string>()
        {
            { "PV Alarm Sel",                         "PV Alarm Selection Code"},
            { "PV Transfer Fun",                      "PV Transfer Function Code"},
            { "PV Upper and Lower Rge Units",         "PV Upper and Lower Range Values Units Code"},
            { "PV Upper Range Val",                   "PV Upper Range Value"},
            { "PV Lower Range Val",                   "PV Lower Range Value"},
            { "PV Damping Value",                     "PV Damping Value"},
            { "Write Protect Code",                   "Write Protect Code"},
            { "PV Analog Chl Flgs",                   "PV Analog Channel Flags"},
        };
    }
}
